package com.myworld.service;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;

import com.myworld.model.Person;

@CacheConfig(cacheNames="demoInfo")
public interface PersonService {
	 
	 @Cacheable(key="#id+'_'+#id")
     public Person findById(String id);
	 
	 
	 @Cacheable(key="#id+'_'")
     public Person findById1(String id);
     
     
	 @Caching(evict={
			 @CacheEvict(key="#id+'_'+#id"),
			 @CacheEvict(key="#id+'_'")
	 })
     public void deleteFromCache(String id);
          
}
